import java.sql.*;
import java.util.ResourceBundle;

public class Demo12 {
    public static void main(String[] args) {
        String driver;
        String url;
        String user;
        String password;
        ResourceBundle resourceBundle=ResourceBundle.getBundle("jdbc");
        driver=resourceBundle.getString("driverClass");
        url=resourceBundle.getString("url");
        user=resourceBundle.getString("user");
        password=resourceBundle.getString("password");
        try {
            Class.forName(driver);
            Connection connection=DriverManager.getConnection(url,user,password);
            Statement statement=connection.createStatement();
            String sql = "insert into demo(id,name,password)values('3','张三','123456')";
            int row = statement.executeUpdate(sql);
            System.out.println("影响了数据库" + row + "条数据");
            statement.close();
            connection.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}


